package com.cuit.riskassessment.service.impl;


import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.riskassessment.dao.isms.NewsManageMapper;
import com.cuit.riskassessment.service.DynManageService;
import com.cuit.riskassessment.service.NewsManageService;
import com.cuit.riskassessment.vo.News;
@Service(value="dynService")
public class DynManageServiceImpl implements DynManageService {
	@Autowired
	@Resource(name="newsManageMapper")
	private NewsManageMapper newsMapper;

	@Override
	public boolean add(News news) {
		// TODO Auto-generated method stub
		return newsMapper.addDyn(news)>0?true:false;
	}

	@Override
	public List<News> page(Integer start, Integer limit) {
		// TODO Auto-generated method stub
		return newsMapper.pageDyn(start,limit);
	}

	@Override
	public Object getTotalCount() {
		// TODO Auto-generated method stub
		return newsMapper.getDynTotal();
	}

	@Override
	public void del(int[] ids) {
		for(int i:ids){
			newsMapper.delControl(i);
		}
	}

	@Override
	public boolean update(News news) {
		// TODO Auto-generated method stub
		return newsMapper.updateControl(news)>0?true:false;
	}

}
